package com.zzl.test.aop;

import org.aspectj.lang.ProceedingJoinPoint;

/**
 * description: 切面类（处理事务）
 * @author 朱正磊
 * @date 2019-08-13 10:37:46
 */
public class TransactionAop {

    public void beginTransaction() {
        System.out.println("【前置通知】开启事务..");
    }

    public void commit() {
        System.out.println("【后置通知】提交事务..");
    }

    public void afterReturning() {
        System.out.println("【返回后通知】");
    }

    public void afterThrowing() {
        System.out.println("【异常通知】");
    }

    public void around(ProceedingJoinPoint point) throws Throwable {
        System.out.println("【环绕前：】");
        point.proceed(); //执行目标方法
        System.out.println("【环绕后：】");
    }

}
